// 同ES6一样，函数的参数可以给默认值
function fun2(a:number,b:number = 1):number {
    return a + b;
}

// 函数参数如何解构？
// 方式一：给定每一个参数的类型
function fun3({name = "匿名",word = "你好"}:{name:string,word:string} = {name:"nameless",word:"hello"}):void {
    console.log(`${name}说:${word}`);
}

// 方式二：any大法
function fun4({name,word}:any):void {
    console.log(`${name}说:${word}`);
}

fun3();
fun3({name: "奉先",word: undefined});
fun4({name: "Hydra",word: "Hello"})
